home *** CD-ROM | disk | FTP | other *** search
- // BannerView.h : interface of the CBannerView class
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_BANNERVIEW_H__ACA52AA3_9CE1_11D1_87E0_006097BA8D75__INCLUDED_)
- #define AFX_BANNERVIEW_H__ACA52AA3_9CE1_11D1_87E0_006097BA8D75__INCLUDED_
-
- #include "BannDlg.h" // Added by ClassView
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
-
- #include "Metrics.h"
-
- class CBannerView : public CScrollView
- {
- protected: // create from serialization only
- CBannerView();
- DECLARE_DYNCREATE(CBannerView)
-
- // Attributes
- public:
- CBannerDoc* GetDocument();
-
- // Operations
- public:
-
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CBannerView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- protected:
- virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
- virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE);
- virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
- virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnEndPrinting(CDC*, CPrintInfo* pInfo);
- virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- //}}AFX_VIRTUAL
-
- // Implementation
- public:
- int m_nCurrZoom; // an index into CBannerMetrics zoom array
- BOOL GetCenterH()
- { return m_BannerDlg.m_bCenterH; }
- BOOL GetCenterV()
- { return m_BannerDlg.m_bCenterV; }
- BOOL GetBorder()
- { return m_BannerDlg.m_bBorder; }
- CString GetBannerText()
- { return m_BannerDlg.m_strBannerText; }
- CSize GetTextSize(CDC *pDC, int nCurrZoom = -1)
- { return m_BannerDlg.GetTextSize(pDC, nCurrZoom); }
- BOOL CreateBannerFont(CDC *pDC, CFont *pFont, int nCurrZoom = -1)
- { return m_BannerDlg.CreateFont(pDC, pFont, nCurrZoom); }
- void ComputeSizes(CDC *pdcPrinter = NULL);
-
- // GetMargins()
- // CRect m_rcMargins; // In 1000ths of inches
-
- virtual ~CBannerView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
-
- // Generated message map functions
- protected:
- CFont m_fontScreen;
- CFont m_fontPrinter;
- CRect m_rcMarginsScreen;
- CRect m_rcMarginsPrinter;
- CRect m_rcMarginsPrintDlg;
- CSize m_sizePageScreen;
- CSize m_sizePagePrinter;
- CSize m_sizeTextScreen;
- CSize m_sizeViewScreen;
- CSize m_sizeTextPrinter;
- CSize m_sizeViewPrinter;
- CSize m_sizePageCount;
- BOOL m_bRuler;
- BOOL m_bPageBreaks;
-
- CSize ScaleSize(CSize& base, CSize& num, CSize& den)
- {
- ASSERT((den.cx != 0) && (den.cy != 0));
- return CSize(base.cx * num.cx / den.cx,
- base.cy * num.cy / den.cy);
- }
-
- CRect ScaleSize(CRect& base, CSize& num, CSize& den)
- {
- ASSERT((den.cx != 0) && (den.cy != 0));
- return CRect(base.left * num.cx / den.cx,
- base.top * num.cy / den.cy,
- base.right * num.cx / den.cx,
- base.bottom * num.cy / den.cy);
- }
-
- static int s_nRulerNumberSize;
- static int s_nRulerTickSize;
-
- //{{AFX_MSG(CBannerView)
- afx_msg void OnBannerText();
- afx_msg void OnPageBreaks();
- afx_msg void OnRuler();
- afx_msg void OnUpdateRuler(CCmdUI* pCmdUI);
- afx_msg void OnUpdatePageBreaks(CCmdUI* pCmdUI);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- CBannerDlg m_BannerDlg;
-
- void DrawBanner (CDC *pDC, CSize& scroll, CBannerMetrics& mx);
- void DrawRuler (CDC *pDC, CSize& scroll, CBannerMetrics& mx);
- void DrawPageBreaks(CDC *pDC, CSize& scroll, CBannerMetrics& mx);
- };
-
- #ifndef _DEBUG // debug version in BannerView.cpp
- inline CBannerDoc* CBannerView::GetDocument()
- { return (CBannerDoc*)m_pDocument; }
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_BANNERVIEW_H__ACA52AA3_9CE1_11D1_87E0_006097BA8D75__INCLUDED_)
-